// 创建右键菜单
chrome.contextMenus.create({
  id: "parent",
  title: 'DECODE 解码',
  contexts: ['page']
})
// 监听右键菜单单击事件，创建的tab标签页，指向的页面为index.html
chrome.contextMenus.onClicked.addListener((info, tab) => {
  if(info.menuItemId == 'parent') {
      console.log('menu......');
      chrome.tabs.create({
          url: "index.html" 
      })
  }
})
// 消息监听
chrome.runtime.onMessage.addListener((message) => {
  let keyArrys = Object.keys(message);
  let valueArrays = Object.keys(message);
  keyArrys && keyArrys.map((res, index) => chrom.storage.local.set({[res] : valueArrays[index]}))
})